package org.example.feign;

import org.example.entity.DeliveryAddress;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@FeignClient(name = "address-service")
public interface AddressFeignClient {
    @GetMapping("/elm-api/deliveryaddress/listDeliveryAddressByUserId")
    List<DeliveryAddress> listDeliveryAddressByUserId(@RequestParam("userId") String userId);

    @GetMapping("/elm-api/deliveryaddress/getDeliveryAddressById")
    DeliveryAddress getDeliveryAddressById(@RequestParam("daId") Integer daId);

    @PostMapping("/deliveryaddress/saveDeliveryAddress")
    int saveDeliveryAddress(@RequestBody DeliveryAddress deliveryAddress);

    @PutMapping("/deliveryaddress/updateDeliveryAddress")
    int updateDeliveryAddress(@RequestBody DeliveryAddress deliveryAddress);

    @DeleteMapping("/deliveryaddress/removeDeliveryAddress")
    int removeDeliveryAddress(@RequestParam("daId") Integer daId);
}